package com.repair.admin.category.service.impl;

import com.repair.admin.category.service.AdminCategoryService;
import com.repair.api.category.request.param.ServiceCategoryDeleteParam;
import com.repair.api.category.request.param.ServiceCategoryGetParam;
import com.repair.api.category.request.param.ServiceCategorySaveParam;
import com.repair.api.category.response.data.CategoryInfo;
import com.repair.api.category.service.CategoryFacadeService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminCategoryServiceImpl implements AdminCategoryService {
    @DubboReference
    private CategoryFacadeService categoryFacadeService;
    @Override
    public List<CategoryInfo> getAllCategories(ServiceCategoryGetParam serviceCategoryGetParam) {
        List<CategoryInfo> allCategories = categoryFacadeService.getAllCategories(serviceCategoryGetParam);
        return allCategories;
    }

    @Override
    public void save(ServiceCategorySaveParam serviceCategorySaveParam) {
        categoryFacadeService.save(serviceCategorySaveParam);
    }

    @Override
    public void delete(ServiceCategoryDeleteParam serviceCategoryDeleteParam) {
        categoryFacadeService.delete(serviceCategoryDeleteParam);
    }
}